import { request } from "@/utils/service"
import type * as obj from "./types/chapter"
import { IdForm } from "../common/common"

export function getTableDataApi(data: IdForm) {
  return request<obj.TableData[]>({
    url: "/mp/chapter/lesson",
    method: "get",
    params: data
  })
}

export function saveSortDataApi(data: obj.SortDataRequest) {
  return request<string>({
    url: "/mp/chapter/sort",
    method: "post",
    data
  })
}

/** 获取用户详情 */
export function saveTableDataApi(data: obj.CreateOrUpdateTableRequestData) {
  return request<string>({
    url: "/mp/chapter/save",
    method: "post",
    data
  })
}

export function deleteTableDataApi(data: IdForm) {
  return request<string>({
    url: "/mp/chapter/delete",
    method: "post",
    data
  })
}
